<template>
  <div class="main_box" style="padding:10px">
    <div class="add_wrap">
      <el-form label-width="200px">
        <div class="tit">
          <h2>基础信息</h2>
          <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList">返回
          </el-button>
        </div>
        <el-row>
          <el-form-item label="应用名称:">
            <span>{{ dataInfo.name }}</span>
          </el-form-item>
          <el-form-item label="应用编号:">
            <span>{{ dataInfo.code }}</span>
          </el-form-item>
          <el-form-item label="logo:">
            <el-image :preview-src-list="[dataInfo.logo]" :src="dataInfo.logo"></el-image>
          </el-form-item>
          <el-form-item label="应用ID:">
            <span>{{ dataInfo.appId }}</span>
          </el-form-item>
          <el-form-item label="应用密钥:">
            <span>{{ dataInfo.appSecret }}</span>
          </el-form-item>
          <el-form-item label="应用类型:">
            <span v-if="dataInfo.programType===1">用户小程序</span>
            <span v-if="dataInfo.programType===2">商户小程序</span>
            <span v-if="dataInfo.programType===10">APP</span>
          </el-form-item>
          <el-form-item label="应用介绍:">
            <span>{{ dataInfo.introduce }}</span>
          </el-form-item>
          <el-form-item label="租户名称:">
            <span>{{ dataInfo.tenantName }}</span>
          </el-form-item>
          <el-form-item label="创建人:">
            <span>{{ dataInfo.createUserName }}</span>
          </el-form-item>
          <el-form-item label="创建时间:">
            <span>{{ dataInfo.createDate }}</span>
          </el-form-item>
          <el-form-item label="修改人:">
            <span>{{ dataInfo.modifyUserName }}</span>
          </el-form-item>
          <el-form-item label="修改时间:">
            <span>{{ dataInfo.modifyDate }}</span>
          </el-form-item>
          <el-form-item label="备注:">
            <span>{{ dataInfo.remark }}</span>
          </el-form-item>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
import ProgramApi from '@/api/system/program';

export default {
  data() {
    return {
      dataInfo: {},
    };
  },
  computed: {},
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      ProgramApi.getProgram({id: this.$route.query.id}).then(res => {
        this.dataInfo = res.data
      })
    },
    returnList() {
      this.$store.dispatch('delView', this.$route);
      this.$router.push({path: '/organ/programManagement'})
    }
  },

}

</script>
<style lang="scss" scoped>
@import "@/assets/css/views/add.scss";
</style>
